﻿<!DOCTYPE html> 
<html>
    <head>
        <meta charset="utf-8">
		<meta id="viewport_meta" name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		
        <!-- PhoneGap Script support -->
		<script src="scripts/cordova-2.2.0.js" type="text/javascript"></script>
		
		<!-- MOBILE SCRIPTS -->
		<script src="scripts/jquery-1.7.1.min.js"></script>
		<script src="scripts/jquery.dotdotdot-1.5.3.js"></script>
		<script src="scripts/iscroll.js"></script>
        <script src="scripts/EventDispatcher.js" type="text/javascript"></script>

		<!-- MANAGERS SCRIPTS -->
		<script src="managers/Config.js" type="text/javascript"></script>
        <script src="managers/Rotter.js" type="text/javascript"></script>
		<script src="managers/TemplateManager.js" type="text/javascript"></script>
		<script src="managers/PageManager.js" type="text/javascript"></script>
        <script src="managers/HTTPManager.js" type="text/javascript"></script>
        <script src="managers/UploadManager.js" type="text/javascript"></script>
        <script src="managers/Utils.js" type="text/javascript"></script>
		<script src="managers/Parser.js" type="text/javascript"></script>
        
        <!-- PAGES SCRIPTS -->
		<script src="scripts/pages/post.js" type="text/javascript"></script>
        <script src="scripts/pages/forums.js" type="text/javascript"></script>
		<script src="scripts/pages/forum_posts.js" type="text/javascript"></script>
		<script src="scripts/pages/new_post.js" type="text/javascript"></script>
		<script src="scripts/pages/edit_post.js" type="text/javascript"></script>
		<script src="scripts/pages/comment_post.js" type="text/javascript"></script>
		<script src="scripts/pages/bookmarks.js" type="text/javascript"></script>
		<script src="scripts/pages/login.js" type="text/javascript"></script>
		<script src="scripts/pages/settings.js" type="text/javascript"></script>
		<script src="scripts/pages/splash.js" type="text/javascript"></script>
		<script src="scripts/pages/inbox.js" type="text/javascript"></script>
		
		<link rel="stylesheet" type="text/css" href="styles/main.css"/>
		
        <title>הפורום האקסקלוסיבי של רוטר</title>
		<style type="text/css" media="all">
		body,ul,li {
			padding:0;
			margin:0;
			border:0;
		}
		</style>
        <script type="application/javascript">
        	document.addEventListener("deviceready", onDeviceReady, false);
        	
        	function onDeviceReady() {
				if (Utils.isAndroid()) {
                    document.addEventListener("menubutton", function(e) {
						toggleView();
					}, false);
					document.addEventListener("backbutton", function(e) {
						PageManager.goBack();
					}, false);
				}
        	}
        
			window.addEventListener("load", function(e) {
				$.support.cors = true;
				Rotter.init();
			});
			
			var lastMenuPress;
			var menuPressTimeout;
			var isScreenFull = false;
			function toggleView() {
				if (lastMenuPress == null || (new Date()).getTime()-lastMenuPress > 300 || !Utils.isAndroid()) {
					if (!isScreenFull) {
						if (menuPressTimeout != null)
							clearTimeout(menuPressTimeout);
						menuPressTimeout = setTimeout(function() {
							if ($("#footer").css("display") == "block") {
								$("#loading_overlay").css("bottom", "0px");
								$("#ajax_content").css("paddingBottom", "0px");
								$("#footer").hide();
							}
							else {
								$("#loading_overlay").css("bottom", "54px");
								$("#ajax_content").css("paddingBottom", "54px");
								$("#footer").show();
							}
						}, 300);
					}
				}
				else {
					if (menuPressTimeout != null)
						clearTimeout(menuPressTimeout);
					menuPressTimeout = setTimeout(function() {
						if ($("#footer").css("display") == "block") {
							$("#loading_overlay").css("top", "0px");
							$("#loading_overlay").css("bottom", "0px");
							$("#ajax_content").css("paddingBottom", "0px");
							$("#ajax_content").css("paddingTop", "0px");
							$("#footer").hide();
							$("#header").hide();
							isScreenFull = true;
						}
						else {
							$("#loading_overlay").css("top", "44px");
							$("#loading_overlay").css("bottom", "54px");
							$("#ajax_content").css("paddingTop", "44px");
							$("#ajax_content").css("paddingBottom", "54px");
							$("#footer").show();
							$("#header").show();
							isScreenFull = false;						
						}
					}, 300);
				}
				lastMenuPress = (new Date()).getTime();
			}
        </script>
    </head>
    <body>
		<div id="modal_overlay" style="display:none;">
			<div id="modal_window">
			</div>
		</div>
		
		<div id="loading_overlay" style="display:none;margin:auto auto">
			<table style="width:100%;height:100%;" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center" valign="middle">
						<div id="loading_block">
							<img src="images/loader_black.gif"/>
							<br/>
							<div id="loading_caption"></div>
						</div>
					</td>
				</tr>
			</table>
		</div>
		
		<div id="ajax_content"></div>
		<div id="header">
			<table style="width:100%;height:100%;" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center" style="width:74px;">
						<div style="width:74px;overflow-x:hidden;padding-right:0px;" id="header_right_container">
						</div>
					</td>
					<td><div id="header_title" ontouchstart="toggleView();"></div></td>
					<td id="header_left_container" align="left" style="width:70px;"><div class="header_button" style="width:35px;" id="header_button" onclick="event.preventDefault();event.stopPropagation();PageManager.goBack();">חזרה</div></td>
				</tr>
			</table>
		</div>
		<div id="footer">
			<table style="width:100%;height:100%;border:1px solid #000000" cellpadding="0" cellspacing="0">
				<tr>
					<td id="footer_forums" style="width:25%;" onClick="PageManager.footerClick(event, this, 'forums');" ontouchstart="PageManager.footerClick(event, this, 'forums');">פורומים</td>
					<td id="footer_bookmarks" style="width:25%;" outouchstart="PageManager.footerClick(event, this, 'bookmarks');" onClick="PageManager.footerClick(event, this, 'bookmarks');">מועדפים</td>
					<td id="footer_inbox" style="width:25%;" outouchstart="PageManager.footerClick(event, this, 'inbox');" onClick="PageManager.footerClick(event, this, 'inbox');">ת.ד.</td>
					<td id="footer_main" style="width:25%;" onClick="PageManager.footerClick(event, this, 'splash');" ontouchstart="PageManager.footerClick(event, this, 'splash');">ראשי</td>
				</tr>
			</table>
		</div>
    </body>
</html>